package simpleSolutions.vale;

import java.util.List;

import com.google.inject.Inject;

import roboguice.activity.RoboActivity;
import simpleSolutions.vale.data.Repositorio;
import simpleSolutions.vale.exceptions.SaveException;

public class ValeActivity<T, R extends Repositorio<T, ?>> extends RoboActivity {
	
	@Inject protected T entidade;
	
	@Inject protected R repositorio;
	
	protected void salvar() throws SaveException
	{
		repositorio.save(entidade);
	}
	
	protected List<T> ListarTodos()
	{
		return repositorio.getAll();
	}
}
